{{extend 'layout.html'}}


{{for s in sorts:}}
[{{=A(s,_href=URL(r=request,args=[category,s,page]))}}]
{{pass}}
{{if page>0:}}[{{=A('prev',_href=URL(r=request,args=[category,sort,page-1]))}}]{{pass}}
{{if page<3 and len(news)>50:}}[{{=A('next',_href=URL(r=request,args=[category,sort,page+1]))}}]{{pass}}
<table>
{{for k,item in enumerate(news):}}{{if k==50: continue}}

<tr>

	<td>
  <table border="0" cellpadding="0" cellspacing="0">
     <tr><td style="height:10px">{{=A(IMG(_src=URL(r=request,c='static',f='up.png')),_href=URL(r=request,f='vote',args=['up',item.id]))}}</td></tr>
     <tr height="10px"><td class="score">{{=item.score}}</td></tr>
     <tr><td>{{=A(IMG(_src=URL(r=request,c='static',f='down.png')),_href=URL(r=request,f='vote',args=['down',item.id]))}}</td></tr>
  </table>
</td>
<td>
  <table>
<tr>
<!-- include  -->
	<br/>
  <td class="article">
  {{if item.url.strip().lower()=='self':}}
    {{=A(item.title,_href=URL(r=request,f='comments',args=[item.id]))}}
  {{else:}}
    {{=A(item.title,_href=URL(r=request,f='read',args=[item.id]))}}
  {{pass}}
  </td>
	</tr>
	<tr>
		<th>{{="score "}}{{=item.score}}{{="view "}}{{=item.clicks}}</th>
	</tr>
	<tr>
		<td>{{=item.foreword}}</td>
	</tr>
  <tr><td><i>submitted {{=timesince(item.post_time,now)}} ago by {{=A(item.author_alias,_href=URL(r=request,f='person',args=[item.author]))}}</i>
  </td></tr>
  <tr><td>
  {{=A('%i comments'%item.comments,_href=URL(r=request,f='comments',args=[item.id]))}} {{=A('report',_href=URL(r=request,f='report',args=[item.id]))}} {{if item.author==session.authorized:}} {{=A('delete',_href=URL(r=request,f='delete',args=[item.id]))}} {{pass}}
  </td></tr>
  </table>
</td></tr>
{{pass}}
</table>